#ifndef CXMLCONTRUCTOR_H
#define CXMLCONTRUCTOR_H

#include <libxml/encoding.h>
#include <libxml/xmlwriter.h>
#include <string>

#define FUNCTION "function"
#define FUNCTIONNAME "functionname"
#define RETURNTYPE "returntype"

class CXmlConstructor
{
	public:
		/*
		Constructor
		*/
		CXmlConstructor();

		/*
		Destructor
		*/
		~CXmlConstructor();

		void
			AddFunctionDeclaration(const char *fname, const char *ftype);

		void
			AddFunctionDeclaration();

		void
			SetReturnType (const char *rt);
		void
			SetReturnType (std::string &rt);

		void
			SetFunctionName (const char *fn);


#ifdef _DEBUG
		void
			printTreeToSTDIO();
#endif
	protected:
	
	private: 
		
		/* document pointer */
		xmlDocPtr _doc;	
		/*root pointers */
		xmlNodePtr _root_node;

		const char
				*_fn, /* function name */
				*_fs, /*  */
				*_rt /* type of return value */
				;
		
		void
			_AddFunctionDeclaration(const char *fname, const char *ftype);
};

#endif